<template>
  <div id="orderManager">
    <!-- <h1>这是订单管理页面</h1> -->
    <!-- 选项卡 -->
    <div class="orderManager_top">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane v-for="item in nameList" :key="item" :label="item" :name="item">
          <orderTable ref="msg" />
        </el-tab-pane>
      </el-tabs>
    </div>

  </div>
</template>
<script>
// 引入表格组件
import orderTable from './table'
export default {

  components: {
    orderTable// 挂载
  },
  data() {
    return {
      activeName: '所有订单',
      nameList: ['所有订单', '待支付', '待派单', '待接单', '待服务', '待确认', '已完成']
    }
  },
  mounted() {
    this.$refs.msg[0].sendItem(this.activeName)
  },
  methods: {
    handleClick(tab, event) {
      // console.log(tab.index);
      // console.log(this.$refs.msg[tab.index]);
      this.$refs.msg[tab.index].sendItem(this.activeName)
    }
  }
}
</script>
<style scoped>
    #orderManager{
        padding: 20px;
    }

</style>
